/**
 * FileName: MemberIntefaceImpl
 * Author:   杨兴
 * Date:     2019/8/14 10:20
 * Description: 会员服务实现
 */
package com.xiongmao.gongyu.service.impl;

import com.xiongmao.gongyu.mybatis.SearchIdPhrase;
import com.xiongmao.gongyu.mybatis.SearchIdPhraseDao;
import com.xiongmao.gongyu.service.MemberInteface2;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MemberIntefaceImpl2 implements MemberInteface2 {

     @Autowired
    SearchIdPhraseDao searchIdPhraseDao;
     @Value("${spring.datasource.url}")
     String url;

//    @HystrixCommand(fallbackMethod = "fallBackMember")
    @RequestMapping("/getMemberData2")
    public String getMemberData(String name){
        System.out.println("getMemberData2"+System.currentTimeMillis());

        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("helloworld");
        return "hello world"+name;
    }

    public String fallBackMember(String name){
        System.out.println("member服务降级");
        return "member服务降级";
    }
    @RequestMapping("/testMybatis")
    public String testMybatis(){
        System.out.println(url);
        List<SearchIdPhrase> one = searchIdPhraseDao.findOne();
        System.out.println(one);
        return "vcg";
    }
}
